from fastapi import APIRouter, Depends
from loguru import logger
from starlette.requests import Request
from src.config.auth import auth_depend
from src.config.log import log_depend, log_user_id

router = APIRouter(dependencies=[Depends(auth_depend), Depends(log_depend)], tags=["首页"])


@router.get("/", status_code=200, summary="index请求", )
async def root(request: Request):
    logger.bind(user_id=log_user_id.get()).info(f" 进入首页")
    return {"message": f"Hello World!!!,,{request.state.login_user}"}
